<?php
/**
 * Created by openXtiger.org.
 * User: xtiger
 * Date: 2009-5-18
 * Time: 10:36:01
 */
function hi_loginmodel__invoke() {
    if(func_num_args() <=0 ) return NULL;
    $method = 'loginmodel_'.func_get_arg(0);
    $args = func_get_args();
    $args[0] = '__xt__load';
    if(function_exists($method))
        return call_user_func_array($method, $args);   
}

function loginmodel_login($load, $username, $pswd) {
    $db = $load('db');
    return $db->result_first("SELECT uid FROM cdb_members WHERE username='".addslashes($username)."'");
}
?>